<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/categories' }">
        <a href="/">数据统计</a>
      </el-breadcrumb-item>
      <el-breadcrumb-item>数据报表</el-breadcrumb-item>
    </el-breadcrumb>

    <!-- 卡片视图 -->
    <el-card>
      <div id="main" style="width: 600px;height:400px;"></div>
    </el-card>
  </div>
</template>

<script>
import echarts from "echarts";
import _ from "lodash"

export default {
  data() {
    return {};
  },
  created() {},
  mounted() {
    var myChart = echarts.init(document.getElementById("main"));

    // 指定图表的配置项和数据
    var data = [];

    for (var i = 0; i <= 100; i++) {
      var theta = (i / 100) * 360;
      var r = 5 * (1 + Math.sin((theta / 180) * Math.PI));
      data.push([r, theta]);
    }

    var option = {
      title: {
        text: "极坐标双数值轴"
      },
      legend: {
        data: ["line"]
      },
      polar: {},
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "cross"
        }
      },
      angleAxis: {
        type: "value",
        startAngle: 0
      },
      radiusAxis: {},
      series: [
        {
          coordinateSystem: "polar",
          name: "line",
          type: "line",
          data: data
        }
      ]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
};
</script>

<style lang="less">
</style>